<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <link type="text/css" rel="stylesheet" href="main.css">
    <!--jquery -->
	<script type="text/javascript" src="../js/jquery/jquery-2.0.3.min.js" ></script>
	
	<script type="text/javascript" src="../js/share.js"></script>
		
	<script type="text/javascript">
	var itemno = "";
	var applyid = "";
	var nodeno = "";
	var orgcode = "";
	var nextnodecode1 = "";
	var selectID = "userlist";
	var applyno = "";

	$(function(){
		applyno = getUrlParam("applyno");
		bindApply(applyno);
	})


	function bindApply(applyno){
		$.ajax({ 
			url: basePath() + 'business/getapplyinfo.do',
			data: {"applyno": applyno},
			dataType: "json",
	        contentType: "application/json",
			success: function(data){
		    	if(data.result == 1){
		    		var jsonApply = data.datas;
//		    		var jsonBusiness = data.datas.business;
//		    		var jsonMaterial = data.datas.material;
		    		
		    		bindApplyForm(jsonApply);
		    		
		    		//绑定业务资料
		    		bindBusinessForm(jsonApply['applyid'], jsonApply['itemno']);
//		    		
//		    		//绑定附件材料
		    		bindMaterialListForm(jsonApply['applyid']);	    
		    		
		    		bindShip(jsonApply['applyid']);
		    	}
	      	}
		});
	}

	function bindApplyForm(jsonApply){
		for(var d in jsonApply){//遍历json对象的每个key/value对,p为key
			if(d == 'applytime'){
				$('#' + d).html(formatDate(jsonApply[d], 'yyyy-mm-dd'));
			}
			else if(d == 'nodename'){
				if(jsonApply[d] == '办结')
					$('#' + d).html('<span style="color:green;font-weight: bold;">' + jsonApply[d] + '</span>');
				else if(jsonApply[d].indexOf('补正') >= 0){
					$('#' + d).html('<span style="color:red;font-weight: bold;">' + jsonApply[d] + '</span>');
					$('#correction').show();
					$('#correction').attr('href', 'correction.html?applyno=' + applyno);
				}
				else if(jsonApply[d].indexOf('申报') >= 0){
					$('#' + d).html('<span style="color:red;font-weight: bold;">未提交</span>');
					$('#edit').show();
					$('#edit').attr('href', 'edit.html?applyno=' + applyno);
				}
	        	else if(jsonApply[d].indexOf('受理') >= 0)
	        		$('#' + d).html('<span style="color:blue; font-weight: bold;">待受理</span>');
				else{
					$('#' + d).html('<span style="color:blue;font-weight: bold;">已受理</span>');
				}
			}
			else{
				$('#' + d).html(jsonApply[d] == '' ? '/' : jsonApply[d]);
			}
		}
	}

	function bindBusinessForm(applyid, itemno){

		$.ajax({ 
			url: basePath() + 'business/getbusinessinfo.do',
			data: {"applyid": applyid, "itemno": itemno},
			dataType: "json",
	        contentType: "application/json",
			success: function(data){
		    	if(data.result == 1){
		    		var jsonBusiness = data.datas;

		    		for(var d in jsonBusiness){	//遍历json对象的每个key/value对,d为key
		    			if(d == 'worktime'){
		    				$('#' + d).html(formatDate(jsonBusiness[d], 'yyyy-mm-dd'));
		    			}
		    			else{
		    				$('#' + d).html(jsonBusiness[d] == '' ? '/' : jsonBusiness[d]);
		    			}
		    		}
		    	}
	      	}
		});
	}

	function bindMaterialListForm(applyid){

		$.ajax({ 
			url: basePath() + 'business/getmaterialinfo.do',
			data: {"applyid": applyid},
			dataType: "json",
	        contentType: "application/json",
			success: function(data){
		    	if(data.result == 1){
		    		var jsonMaterial = data.datas;

					var k = 1;
					for(var i = 0; i < jsonMaterial.length; i++){
						var materialname = jsonMaterial[i]['materialname'];
						
						var fileid=jsonMaterial[i]['fileid']
						if('' != fileid){
							var materialnameHmtl = k + '、' + materialname + '<br />';
							$('#material').append(materialnameHmtl);
							k++;
						}
					}
		    	}
	      	}
		});
	}
	function bindShip(applyid){
		$.ajax({ 
			url: basePath() + 'business/getshipinfo.do?applyid='+applyid,
			dataType: "json",
			success: function(data){
		    	if(data.result == 1){
		    		var jsonShip = data.datas;
					for(var i = 0; i < jsonShip.length; i++){//这个业务应该只有一艘船
						for(var d in jsonShip[i]){	
			    				$('#' + d).html(jsonShip[i][d] == '' ? '/' : jsonShip[i][d]);
			    		}
					}
		    	}
	      	}
		});
	}
	</script>
    <style>
        table{
        border-style: solid;
        border-width: 1px;
        border-color: black;
        border-collapse: collapse;
        }
    </style>
    <title>《残骸清除责任保险或其他财务保证证书》申请书</title>
</head>
<body>
<h1 style="margin-top: 40px;margin-bottom: 40px;height: 10px" >《残骸清除责任保险或其他财务保证证书》</h1>
<h1 style="margin-bottom: 40px;height: 10px" >申请书</h1>
<table border="1"  align="center" cellspacing="0" cellpadding="0">
    <tr>
        <td colspan="2" align="center" style="height: 40px">船舶名称</td>
        <td colspan="2" align="center" ><span id="shipname" style=" margin-left: 10px;"></span></td>
        <td colspan="2" rowspan="2" align="center">申请<br>单位<br>名称</td>
        <td rowspan="2" colspan="3" align="center"><span id="company" style=" margin-left: 10px;"></span></td>
    </tr>
    <tr>
        <td colspan="2" align="center" style="height: 40px">IMO编号</td>
        <td colspan="2" align="center"><span id="imo" style=" margin-left: 10px;"></span></td>
    </tr>
    <tr>
        <td colspan="2" align="center" style="height: 40px">单位邮编</td>
        <td colspan="2" align="center"></td>
        <td colspan="2" align="center">联系<br>地址</td>
        <td colspan="3" align="center"><span id="contactaddr" style=" margin-left: 10px;"></span></td>
    </tr>
    <tr>
        <td rowspan="2" align="center">联<br>系<br>电<br>话</td>
        <td align="center" style="height: 40px">办公<br>座机</td>
        <td colspan="2" align="center"><span id="telephone" style=" margin-left: 10px;"></span></td>
        <td colspan="2" rowspan="2" align="center">申办人<br>姓名</td>
        <td colspan="3" rowspan="2" align="center"><span id="proposer" style=" margin-left: 10px;"></span></td>
    </tr>
    <tr>
        <td align="center" style="height: 40px">手机</td>
        <td colspan="2" align="center"><span id="mobilephone" style=" margin-left: 10px;"></span></td>
    </tr>
    <tr>
        <td rowspan="5" align="center">申<br>    <br>请</td>
        <td colspan="2" align="center" style="height: 40px">申请证书（文<br>书）名称</td>
        <td colspan="6" align="center">残骸清除责任保险或其他财务保证证书</td>
    </tr>
    <tr>
        <td colspan="8" align="center" style="height: 40px">申请资料情况</td>
    </tr>
    <tr>
        <td colspan="3" align="center" style="height: 40px"></td>
        <td align="center">应<br>交</td>
        <td align="center">已<br>交</td>
        <td align="center" ></td>
        <td align="center">应<br>交</td>
        <td align="center">已<br>交</td>
    </tr>
    <tr>
        <td colspan="3" style="height: 65px">1．残骸清除责任保险或其他财务保证证书申请书</td>
        <td> </td>
        <td> </td>
        <td>2．船东互保协会或保险公司等出具的已投保残骸清除责任保险或其他财务保证有效单据</td>
        <td > </td>
        <td > </td>
    </tr>
    <tr>
        <td colspan="3" style="height: 65px">3．船舶国籍证书复印件</td>
        <td > </td>
        <td > </td>
        <td >4．委托书、委托人身份证明复印件和被委托人身份证明原件及复印件</td>
        <td > </td>
        <td > </td>
    </tr>
    <tr>
        <td></td>
        <td colspan="8" height="120px">
           <p style="padding-left: 20px">兹承诺：</p>
            <p style="padding-left: 40px;height: 60px">以上申请资料真实、有效，否则，承担由此而产生的一切后果。</p>
            <p style="padding-left: 350px;height: 25px">船舶/船公司（章）</p>
            <p style="display:inline;padding-left: 350px;height: 15px">申请日期：</p>
            <p style="display:inline;">年</p>
            <p style="display:inline;text-decoration: underline;"></p>
            <p style="display:inline;">月</p>
            <p style="display:inline;text-decoration: underline;"></p>
            <p style="display:inline;">日</p>
        </td>
    </tr>
    <tr>
        <td colspan="4" align="center" height="70px">受理日期（政务受理人<br>员填写）</td>
        <td colspan="5"></td>
    </tr>
    <tr style="border: none; border-width: 0px">
        <td class="td-12" ></td>
        <td class="td-13" > </td>
        <td class="td-13" > </td>
        <td class="td-13" > </td>
        <td class="td-12" ></td>
        <td class="td-12" ></td>
        <td class="td-14" ></td>
        <td class="td-12" > </td>
        <td class="td-12" > </td>
    </tr>
</table>
</body>
</html>